package com.stx.design.mediator;

import java.util.ArrayList;
import java.util.List;

public class GameQQGroup implements QQGroup {
	
	private List<Person> personList;
	
	public GameQQGroup(){
		personList = new ArrayList<Person>();
	}
	
	public void addPerson(Person person){
		personList.add(person);
	}
	
	@Override
	public void exchange(Person person, String message) {
		for(Person p : personList){
			if(p == person){
				p.talk(message);
				break;
			}
		}
	}

}
